package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.WmsInventoryStatistics;
import com.ruoyi.system.mapper.WmsInventoryStatisticsMapper;
import com.ruoyi.system.service.IWmsInventoryStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 库存统计Service业务层处理
 *
 * @author ruoyi
 * @date 2025-06-25
 */
@Service
public class WmsInventoryStatisticsServiceImpl implements IWmsInventoryStatisticsService
{
    @Autowired
    private WmsInventoryStatisticsMapper wmsInventoryStatisticsMapper;

    /**
     * 查询库存统计
     *
     * @param id 库存统计主键
     * @return 库存统计
     */
    @Override
    public WmsInventoryStatistics selectWmsInventoryStatisticsById(Long id)
    {
        return wmsInventoryStatisticsMapper.selectWmsInventoryStatisticsById(id);
    }

    /**
     * 查询库存统计列表
     *
     * @param wmsInventoryStatistics 库存统计
     * @return 库存统计
     */
    @Override
    public TableDataInfo<WmsInventoryStatistics> selectWmsInventoryStatisticsList(WmsInventoryStatistics wmsInventoryStatistics, PageQuery pageQuery)
    {
        Page<WmsInventoryStatistics> page = wmsInventoryStatisticsMapper.selectWmsInventoryStatisticsList(pageQuery.build(),wmsInventoryStatistics);
        return TableDataInfo.build(page);
    }

    /**
     * 新增库存统计
     *
     * @param wmsInventoryStatistics 库存统计
     * @return 结果
     */
    @Override
    public int insertWmsInventoryStatistics(WmsInventoryStatistics wmsInventoryStatistics)
    {
        return wmsInventoryStatisticsMapper.insertWmsInventoryStatistics(wmsInventoryStatistics);
    }

    /**
     * 修改库存统计
     *
     * @param wmsInventoryStatistics 库存统计
     * @return 结果
     */
    @Override
    public int updateWmsInventoryStatistics(WmsInventoryStatistics wmsInventoryStatistics)
    {
        return wmsInventoryStatisticsMapper.updateWmsInventoryStatistics(wmsInventoryStatistics);
    }

    /**
     * 批量删除库存统计
     *
     * @param ids 需要删除的库存统计主键
     * @return 结果
     */
    @Override
    public int deleteWmsInventoryStatisticsByIds(Long[] ids)
    {
        return wmsInventoryStatisticsMapper.deleteWmsInventoryStatisticsByIds(ids);
    }

    /**
     * 删除库存统计信息
     *
     * @param id 库存统计主键
     * @return 结果
     */
    @Override
    public int deleteWmsInventoryStatisticsById(Long id)
    {
        return wmsInventoryStatisticsMapper.deleteWmsInventoryStatisticsById(id);
    }
}
